﻿/*
#**************************************************************************
#  openSIS is a student information system for public and non-public 
#  schools from Open Solutions for Education, Inc. web: www.os4ed.com
#
#  openSIS is  web-based, open source, and comes packed with features that 
#  include student demographic info, scheduling, grade book, attendance, 
#  report cards, eligibility, transcripts, parent portal, 
#  student portal and more.   
#
#  Visit the openSIS web site at http://www.opensis.com to learn more.
#  If you have question regarding this system or the license, please send 
#  an email to info@os4ed.com.
#
#  This program is released under the terms of the GNU General Public License  
#  as  published by the Free Software Foundation, version 2 of the License. 
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#**************************************************************************** 

*/

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using OpenSISPortalNotesDataLayer;


namespace OpenSISPortalNotesBusinessLayer
{
    /// <summary>
    /// Summary description for PortalNotesBL
    /// Done By abhishek on 15th of may 2009
    /// </summary>
    /// 
    public class PortalNotesBL
    {
        private int schoolid;
        private string title;
        private string notes;
        private string sortorder;
        private string visiblestartdate;
        private string visibleenddate;
        private string visiblestaffid;
        private int portalnotesid;
        


        public PortalNotesBL()
        {
            schoolid = 0;
            title = "";
            notes = "";
            sortorder = "";
            visiblestartdate = "01/01/1900";
            visibleenddate = "01/01/1900";
            visiblestaffid = "";
            portalnotesid = 0;
        }
       

        public int SchoolID
        {
            get
            {
                return this.schoolid;
            }
            set
            {
                this.schoolid = value;
            }
        }
        public int PortalNotesid
        {
            get
            {
                return this.portalnotesid;
            }
            set
            {
                this.portalnotesid = value;
            }
        }

        public string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                this.title = value;
            }
        }

        public string Notes
        {
            get
            {
                return this.notes;
            }
            set
            {
                this.notes = value;
            }
        }

        public string Sortorder
        {
            get
            {
                return this.sortorder;
            }
            set
            {
                this.sortorder = value;
            }
        }
        public string Visiblestartdate
        {
            get
            {
                return this.visiblestartdate;
            }
            set
            {
                this.visiblestartdate = value;
            }
        }
        public string Visibleenddate
        {
            get
            {
                return this.visibleenddate;
            }
            set
            {
                this.visibleenddate = value;
            }
        }
        public string Visiblestaffid
        {
            get
            {
                return this.visiblestaffid;
            }
            set
            {
                this.visiblestaffid = value;
            }
        }

        public void PortalNotesadd()
        {
            PortalNotesDL PNDL = new PortalNotesDL();
            PNDL.PortalNotesAdd(this);
           
        
        }
        public System.Data.DataTable CheckSortOrder()
        {
            PortalNotesDL PNDL = new PortalNotesDL();
            DataTable dtsortorder = new DataTable();
           dtsortorder = PNDL.Checksortorder(this);
            return dtsortorder;

        }
        public void PortalNotessearch()
        {


        }
        //public void PopulateStaffTypecheckbox(ref System.Web.UI.WebControls.CheckBoxList chklist)
        //{
        //    PortalNotesDL PNDL = new PortalNotesDL();
        //    DataSet ds = null;
        //    ds = PNDL.Populatestafftypecheckbox();
        //    chklist.DataSource = ds.Tables[0];
        //    chklist.DataTextField = "stf_type_name";
        //    chklist.DataValueField = "stf_type_cd";
        //    chklist.DataBind();

        //}

        public DataTable PopulateStaffTypecheckbox()
        {
            PortalNotesDL PNDL = new PortalNotesDL();
            DataTable ds = null;
            ds = PNDL.Populatestafftypecheckbox().Tables[0];
            return ds;


            //chklist.DataSource = ds.Tables[0];
            //chklist.DataTextField = "stf_type_name";
            //chklist.DataValueField = "stf_type_cd";
            //chklist.DataBind();

        }


        public DataTable PopulateSelectedStaffTypecheckbox()
        {
            PortalNotesDL PNDL = new PortalNotesDL();
            DataTable ds = null;
            ds = PNDL.PopulateSelectedstafftypecheckbox(this).Tables[0];
            return ds;

            //chklist.DataSource = ds.Tables[0];
            //chklist.DataTextField = "stf_type_name";
            //chklist.DataValueField = "stf_type_cd";
            //chklist.DataBind();

        }
        public System.Data.DataTable PopulatePortalNotes()
        {
            DataTable dt = null;
            PortalNotesDL PortalNotesView = new PortalNotesDL();

            dt = PortalNotesView.PortalNotes(this);
            return  dt ;

        
        }
        public void DeletePortalNotes()
        {
            PortalNotesDL PortalNotesdel = new PortalNotesDL();
            PortalNotesdel.DeletePortalNote(this);
        }
        public void UpdatePortalNotes()
        {
            PortalNotesDL PortalNotesUpdate = new PortalNotesDL();
            PortalNotesUpdate.UpdatePortalNotes(this);
        }

        public void UpdateShortOrder()
        {
            PortalNotesDL PortalNotesUpdate = new PortalNotesDL();
            PortalNotesUpdate.UpdatePortalNotesShortOrder(this);
        }


        //public void GetvalufromID()
        //{
        //    PortalNotesDL PortalNotesUpdate = new PortalNotesDL();
        //    DataTable dt = PortalNotesUpdate.PortalNoteDetailsByID(this);
        //    if (dt.Rows.Count > 0)
        //    {
        //        //schoolid = Convert.ToInt32(dt.Rows[0][0]);
        //        title = dt.Rows[0]["title"].ToString();
        //        schoolname = dt.Rows[0]["note"].ToString();
        //        address1 = dt.Rows[0]["visible_start_date"].ToString();
        //        address2 = dt.Rows[0]["visible_end_date"].ToString();
        //        city = dt.Rows[0]["sch_city"].ToString();
        //        state = dt.Rows[0]["State"].ToString();
        //        zip = dt.Rows[0]["sch_zip"].ToString();
        //        fax = dt.Rows[0]["sch_fax"].ToString();
        //        phone = dt.Rows[0]["sch_phn"].ToString();
        //        url = dt.Rows[0]["sch_url"].ToString();
        //        ceeb = Convert.ToInt32(dt.Rows[0]["sch_ceeb_nbr"]);
        //        type = dt.Rows[0]["sch_type"].ToString();
        //        level = dt.Rows[0]["sch_ed_lvl"].ToString();
        //        mingrade = Convert.ToInt32(dt.Rows[0]["sch_min_grade_id"]);
        //        maxgrade = Convert.ToInt32(dt.Rows[0]["sch_max_grade_id"]);
        //        mingradename = dt.Rows[0]["MinGrade"].ToString();
        //        maxgradename = dt.Rows[0]["MaxGrade"].ToString();
        //        postzip = dt.Rows[0]["sch_po_box_zip"].ToString();
        //        poststate = dt.Rows[0]["PostState"].ToString();
        //        postcity = dt.Rows[0]["sch_po_box_city"].ToString();
        //        postbox = dt.Rows[0]["sch_po_box"].ToString();
        //        emerphone = dt.Rows[0]["sch_emer_phn"].ToString();
        //    }
        //}

    }
}

